package com.ace3l.legal.gwt.domainmodule.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Image;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.Viewport;
import com.gwtext.client.widgets.layout.VerticalLayout;
import com.ace3l.legal.gwt.resourcemodule.client.PortalImageBundle;

/**
 * Created by IntelliJ IDEA.
 * User: ageer
 * Date: Jul 23, 2008
 * Time: 7:09:29 PM
 * To change this template use File | Settings | File Templates.
 */
public abstract class Ace3LPageTemplate implements EntryPoint {
    public Panel mainPanel = new Panel();
    public Panel contentPanel = new Panel();
    public HorizontalPanel headerPanel = new HorizontalPanel();
    public VerticalPanel bodyPanel = new VerticalPanel();
    public PortalImageBundle images;
    public NavDirector director = new NavDirector();

    public void onModuleLoad() {
        images = (PortalImageBundle) GWT.create(PortalImageBundle.class);
        
        mainPanel.setStyle("width: 100%; height: 100%;");
        mainPanel.setFrame(false);
        mainPanel.setHeader(false);
        mainPanel.setAutoScroll(true);
        
        contentPanel.setLayout(new VerticalLayout(10));
        contentPanel.setFrame(false);
        contentPanel.setHeader(false);
        contentPanel.setBodyBorder(false);
        contentPanel.setBorder(false);
        contentPanel.setWidth(960);
        contentPanel.setCls("centered");
        bodyPanel.setWidth("100%");
        Image logoTop = images.getTopLogo().createImage();
        logoTop.setStyleName("logo-top");
        headerPanel.add(logoTop);
        headerPanel.setStyleName("headerPanel");
        
        init();
        
        contentPanel.add(headerPanel);
        contentPanel.add(bodyPanel);
        mainPanel.add(contentPanel);
        Viewport v = new Viewport(mainPanel);

    }

    public abstract void init();
}
